// 更换主题
function changeTheme(id) {

	changeTheme_body(id);
	changeTheme_header(id);
	changeTheme_footer(id);
	changeTheme_btn(id);
	//changeTheme_bg(id);
	$("body").attr("style", "display:block");

}
function changTheme_bg(id){
	if(id=="a"){
	  $("body").attr("style", "display:block");
	}
}
// 更换body主题
function changeTheme_body(id) {
	var the = /ui-\w+-\w{1}\s/;
	var s = $("body").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w{1}\s/, s1);
		// alert(s);
		$("body").attr("class", s);
	}
}

// 更换头部主题
function changeTheme_header(id) {
	var the = /ui-\w+-\w{1}\s/;
	var s = $("div#ui_header").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w{1}\s/, s1);
		// alert(s);
		$("div#ui_header").attr("class", s);
	}
}
function changeTheme_footer(id) {
	changeTheme_footera(id);
	changeTheme_footerb(id);
	changeTheme_footerc(id);
	changeTheme_footerd(id);
    changeTheme_footere(id);

}
function changeTheme_btn(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("#head_btn").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("#head_btn").attr("class", s);
      //  $("#off_btn").attr("class",s);
	}
	changeTheme_btn1(id)
}
function changeTheme_btn1(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("#head_btn1").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("#head_btn1").attr("class", s);
	}
}
function changeTheme_footera(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("a#ui_footera").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("a#ui_footera").attr("class", s);
	}
}
function changeTheme_footerb(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("a#ui_footerb").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("a#ui_footerb").attr("class", s);
	}
}
function changeTheme_footerc(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("a#ui_footerc").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("a#ui_footerc").attr("class", s);
	}
}
function changeTheme_footerd(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("a#ui_footerd").attr("class") + "";

	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("a#ui_footerd").attr("class", s);
	}
}
function changeTheme_footere(id) {
	var the = /ui-\w+-\w+-\w{1}\s/;
	var s = $("a#ui_footere").attr("class") + "";
    
	var s1 = the.exec(s) + "";
	if (s1 != null) {
		s1 = s1.replace(/-\w{1}\s/, "-" + id + " ");
		s = s.replace(/ui-\w+-\w+-\w{1}\s/, s1);
		// alert(s);
		$("a#ui_footere").attr("class", s);
	}
}
function onConfirm(button) {
    
    // if press 'Yes'
    if (button === 1){
        //alert("yes");
        navigator.app.exitApp();
    }
}

// PhoneGap Notification 提供的 Confirm API
function showConfirm() {
    navigator.notification.confirm(
                                   '确定要退出程序吗?',  // message
                                   onConfirm,           // callback function
                                   '关闭提示',           // title
                                   '确定,取消'           // confirm 选项，用逗号隔开
                                   );
}